import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import  'element-ui/lib/theme-chalk/index.css';
import 'font-awesome/css/font-awesome.min.css'
import router from "./router";
import store from "./store";
import adminauth from '@/common/adminauth';
import '@/common/dialog';
import './utils/rem'

import hljs from 'highlight.js'
import 'highlight.js/styles/dracula.css' //样式文件
Vue.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})
Vue.config.productionTip = false
Vue.use(ElementUI);

const fontRate = {
  CHAR_RATE: 0.9, // 汉字比率
  NUM_RATE: 0.5, // 数字
  OTHER_RATE: 0.4 // 除汉字和数字以外的字符的比率
}
const fontSize = 14
Vue.use({fontRate, fontSize});

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}
import tinymce from 'tinymce'
import VueTinymce from '@packy-tang/vue-tinymce'

import moment from 'moment'
//注册全局moment
Vue.prototype.$moment = moment
import global from './utils/global.js'

Vue.prototype.global = global
Vue.prototype.global_year_time = "2024";
Vue.prototype.$tinymce = tinymce
Vue.use(VueTinymce)

new Vue({
	router,
	store,
  render: h => h(App),
}).$mount('#app')
